<template>
  <div v-if="Object.keys(goods).length!==0"
       class="base-info">
    <div class="info-title">{{goods.title}}</div>
    <div class="info-price">
      <span class="new-price">
        {{goods.newPrice}}</span>
      <div class="old-sells"
           v-if="goods.discount">
        <span class="old-price">{{goods.oldPrice}} </span>
        <i :style="{backgroundColor:goods.bgColor}">{{goods.discount}}</i>
      </div>

    </div>

    <div class="info-sell-shoucang">
      <span class="info-sell">{{goods.columns[0]}}</span>
      <span class="info-sell">{{goods.columns[1]}}</span>
      <span class="info-sell">{{goods.services[goods.services.length-1].name}}</span>
    </div>
    <div class="info-service">
      <div class="info-service-item"
           v-for="index in goods.services.length-1"
           :key="index.name">
        <img :src="goods.services[index-1].icon"
             alt="">
        <span>{{goods.services[index-1].name}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailProBaseInfo',
  props: {
    goods: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    return {

    }
  },
  components: {
  },
  methods: {

  },
}
</script>
<style scoped>
.base-info {
  margin: 5px 10px;
}
.info-title {
  margin: 5px 0 3px;
  line-height: 20px;
  color: #000;
  font-weight: 500;
  font-size: 13px;
}
.info-price {
  font-size: 15px;
  display: flex;
  color: var(--color-high-text);
}
.new-price {
  font-size: 18px;
  display: inline-block;
  text-align: left;
  font-weight: 600;
  padding: 0.2rem;
}
.old-sells {
  padding-top: 5px;
  position: relative;
}
.old-sells i {
  position: relative;
  top: -5px;
  left: 5px;
  font-style: normal;
  padding: 3px 8px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
}
.old-price {
  font-size: 12px;
  color: #666;
  margin-left: 0.5rem;
  text-decoration: line-through;
  position: relative;
}

.info-sell-shoucang {
  font-size: 13px;
  display: flex;
  margin: 15px 0;
  color: #666;
}
.info-sell {
  flex: 1;
  display: inline-block;
}
.info-service {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.info-service-item {
  padding: 3px 0;
  font-size: 12px;
  text-align: center;
  line-height: 14px;
  vertical-align: middle;
}
.info-service-item img {
  vertical-align: middle;
  height: 14px;
}
.info-service-item span {
  display: inline-block;
}
</style>